package com.jbm.jbmsupplier.activity.repairs;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;

import com.jbm.jbmsupplier.activity.address.MyAddRessRepair;
import com.jbm.jbmsupplier.adapter.FixCategoryGVAdapter;

/**
 * Created by JBMhaier on 2017/8/3.
 */

public class FixCategoryModel {
    private Context context;
    /**
     * 默认初始化header
     *
     *
     */
    public FixCategoryModel( Context context) {

        this.context=context;
    }

    public void setData(GridView fixCatrgoryGv, final String category, final UserAddress useraddress){
        fixCatrgoryGv.setAdapter(new FixCategoryGVAdapter(context));
        fixCatrgoryGv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Intent intent = new Intent(context, MyAddRessRepair.class);
                //这里指的  水路维修....
                intent.putExtra("Fixcategory",position);
//                //这里指的 c公产房 z公租房 j 我爱我家  t通用
//                intent.putExtra("category",category);
//                if(useraddress!=null){
//                    intent.putExtra("address",useraddress);
//                }
                  context.startActivity(intent);
//                ((FixCategoryAty)context).finish();
            }
        });
    }


}
